<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>区域高亮</title>
    <!--leaflet样式文件-->
    <link
      rel="stylesheet"
      href="https://unpkg.com/leaflet@1.7.1/dist/leaflet.css"
    />
    <!--leaflet核心JS文件-->
    <script src="https://unpkg.com/leaflet@1.7.1/dist/leaflet.js"></script>

    <style>
      * {
        padding: 0;
        margin: 0;
      }
      /*必须指定宽高度*/
      #map {
        width: 100%;
        height: 100vh;
      }
    </style>
  </head>
  <body>
    <div id="map"></div>

    <script>
      const mapOptions = {
        center: [37, 112],
        zoom: 5,
        minZoom:7,
        zoomControl: false
      }
      let map = new L.map('map', mapOptions)
      L.tileLayer(
        'http://wprd04.is.autonavi.com/appmaptile?lang=zh_cn&size=1&style=7&x={x}&y={y}&z={z}',
        // 'https://tile.tracestrack.com/base/{z}/{x}/{y}.png?key={ttkey}',
        {
          attribution: 'geojson' // 自定义版权标识
        }
      ).addTo(map)

      // 绘制区域
      geojson = {
        type: 'FeatureCollection',
        features: [
          {
            type: 'Feature',
            properties: {
              adcode: 320500,
              name: '苏州市',
              center: [120.619585, 31.299379],
              centroid: [120.660806, 31.382865],
              childrenNum: 9,
              level: 'city',
              acroutes: [100000, 320000],
              parent: { adcode: 320000 }
            },
            geometry: {
              type: 'MultiPolygon',
              coordinates: [
                [
                  [
                    [120.206593, 31.342565],
                    [120.173715, 31.308817],
                    [120.110224, 31.264002],
                    [119.920013, 31.170913],
                    [119.920957, 31.170384],
                    [119.920275, 31.164406],
                    [119.921074, 31.161216],
                    [119.927928, 31.152951],
                    [119.936757, 31.146558],
                    [119.939822, 31.142955],
                    [119.940475, 31.139584],
                    [119.93988, 31.134598],
                    [119.940199, 31.12863],
                    [119.946589, 31.112016],
                    [119.947025, 31.108941],
                    [119.94624, 31.106228],
                    [119.953022, 31.096782],
                    [119.961431, 31.087387],
                    [119.969766, 31.074282],
                    [119.97209, 31.07202],
                    [119.982778, 31.064924],
                    [119.988514, 31.059223],
                    [119.99245, 31.048299],
                    [119.995572, 31.043166],
                    [119.998433, 31.036184],
                    [119.997605, 31.034606],
                    [120.001729, 31.027119],
                    [120.004692, 31.024908],
                    [120.017021, 31.017795],
                    [120.032531, 31.011781],
                    [120.045702, 31.008185],
                    [120.052441, 31.005741],
                    [120.056914, 31.002649],
                    [120.061328, 30.99798],
                    [120.072888, 30.989041],
                    [120.081238, 30.983944],
                    [120.086974, 30.979674],
                    [120.09441, 30.973231],
                    [120.099129, 30.966347],
                    [120.101642, 30.964173],
                    [120.103762, 30.965105],
                    [120.104357, 30.963448],
                    [120.107451, 30.960627],
                    [120.107088, 30.959709],
                    [120.111023, 30.955917],
                    [120.115118, 30.954649],
                    [120.129945, 30.944981],
                    [120.135144, 30.941901],
                    [120.140358, 30.943337],
                    [120.145615, 30.941357],
                    [120.145891, 30.939726],
                    [120.149652, 30.937474],
                    [120.167369, 30.935014],
                    [120.178522, 30.933862],
                    [120.188586, 30.93227],
                    [120.195469, 30.9306],
                    [120.198795, 30.928309],
                    [120.206114, 30.929759],
                    [120.212315, 30.929021],
                    [120.223686, 30.926691],
                    [120.236581, 30.926134],
                    [120.241316, 30.926497],
                    [120.250755, 30.926225],
                    [120.266148, 30.928244],
                    [120.271376, 30.928659],
                    [120.274644, 30.928193],
                    [120.282515, 30.929863],
                    [120.299854, 30.931649],
                    [120.308074, 30.93227],
                    [120.322247, 30.935209],
                    [120.330975, 30.937772],
                    [120.340894, 30.939959],
                    [120.343334, 30.939985],
                    [120.351147, 30.942561],
                    [120.359264, 30.944593],
                    [120.364507, 30.947129],
                    [120.3711, 30.94876],
                    [120.371652, 30.946469],
                    [120.370214, 30.943441],
                    [120.359453, 30.931908],
                    [120.360542, 30.928232],
                    [120.362677, 30.924594],
                    [120.362706, 30.921668],
                    [120.35941, 30.920322],
                    [120.357783, 30.918108],
                    [120.356926, 30.90889],
                    [120.359366, 30.90305],
                    [120.359003, 30.899671],
                    [120.360121, 30.892794],
                    [120.358393, 30.891733],
                    [120.359018, 30.889544],
                    [120.358015, 30.887096],
                    [120.364667, 30.880465],
                    [120.372436, 30.882162],
                    [120.372349, 30.885011],
                    [120.377257, 30.885633],
                    [120.379407, 30.890774],
                    [120.384693, 30.891564],
                    [120.394698, 30.890774],
                    [120.405793, 30.893792],
                    [120.405241, 30.895889],
                    [120.40665, 30.897379],
                    [120.409656, 30.898],
                    [120.415683, 30.900719],
                    [120.417208, 30.902144],
                    [120.423496, 30.903076],
                    [120.418718, 30.92005],
                    [120.418021, 30.925552],
                    [120.420098, 30.927714],
                    [120.423423, 30.927442],
                    [120.434997, 30.920814],
                    [120.43764, 30.915001],
                    [120.437321, 30.909822],
                    [120.434794, 30.909149],
                    [120.435912, 30.906067],
                    [120.438352, 30.90665],
                    [120.441605, 30.903296],
                    [120.442273, 30.900603],
                    [120.440487, 30.898751],
                    [120.436348, 30.896925],
                    [120.434838, 30.89238],
                    [120.434489, 30.887977],
                    [120.435259, 30.886475],
                    [120.439557, 30.885206],
                    [120.442854, 30.880077],
                    [120.447094, 30.874792],
                    [120.452482, 30.871567],
                    [120.452366, 30.867902],
                    [120.447951, 30.865492],
                    [120.441968, 30.860868],
                    [120.4413, 30.856295],
                    [120.444045, 30.853328],
                    [120.448576, 30.850815],
                    [120.452613, 30.850685],
                    [120.454457, 30.849636],
                    [120.455822, 30.84457],
                    [120.460397, 30.839854],
                    [120.461006, 30.82827],
                    [120.459961, 30.825691],
                    [120.455459, 30.823604],
                    [120.454747, 30.821375],
                    [120.455285, 30.816853],
                    [120.456679, 30.81461],
                    [120.460977, 30.813794],
                    [120.464724, 30.807987],
                    [120.469676, 30.806251],
                    [120.473699, 30.805965],
                    [120.475529, 30.803866],
                    [120.477228, 30.800016],
                    [120.475674, 30.792355],
                    [120.476995, 30.785588],
                    [120.480684, 30.778392],
                    [120.486754, 30.76977],
                    [120.489426, 30.763416],
                    [120.504428, 30.75797],
                    [120.509205, 30.76282],
                    [120.518224, 30.773232],
                    [120.526138, 30.784875],
                    [120.530088, 30.789736],
                    [120.539092, 30.802479],
                    [120.543289, 30.807884],
                    [120.547631, 30.815142],
                    [120.554587, 30.824175],
                    [120.558639, 30.828347],
                    [120.559481, 30.831522],
                    [120.563794, 30.835513],
                    [120.572202, 30.840877],
                    [120.57425, 30.841577],
                    [120.580901, 30.845671],
                    [120.583588, 30.84983],
                    [120.588961, 30.854429],
                    [120.590747, 30.852758],
                    [120.602989, 30.84891],
                    [120.608624, 30.84825],
                    [120.616887, 30.849999],
                    [120.622013, 30.852706],
                    [120.62621, 30.856075],
                    [120.636202, 30.853885],
                    [120.641371, 30.855323],
                    [120.644697, 30.854857],
                    [120.645379, 30.851489],
                    [120.651609, 30.847783],
                    [120.655385, 30.847498],
                    [120.654775, 30.855155],
                    [120.657825, 30.856891],
                    [120.657709, 30.862552],
                    [120.658682, 30.865272],
                    [120.661964, 30.863821],
                    [120.663009, 30.861412],
                    [120.667802, 30.865674],
                    [120.670329, 30.869145],
                    [120.67364, 30.875712],
                    [120.67987, 30.87759],
                    [120.682818, 30.882538],
                    [120.685998, 30.881696],
                    [120.686143, 30.878484],
                    [120.694, 30.874728],
                    [120.692635, 30.87307],
                    [120.693128, 30.870661],
                    [120.696904, 30.869754],
                    [120.699939, 30.867824],
                    [120.703918, 30.870946],
                    [120.70341, 30.875751],
                    [120.700636, 30.88066],
                    [120.702568, 30.884027],
                    [120.713256, 30.88505],
                    [120.712617, 30.891344],
                    [120.7107, 30.898932],
                    [120.709814, 30.907543],
                    [120.711383, 30.910741],
                    [120.71269, 30.9197],
                    [120.709451, 30.933176],
                    [120.705501, 30.940593],
                    [120.70036, 30.946198],
                    [120.697558, 30.950339],
                    [120.68806, 30.953445],
                    [120.684444, 30.955179],
                    [120.688075, 30.960343],
                    [120.69079, 30.962556],
                    [120.694058, 30.966813],
                    [120.698196, 30.970785],
                    [120.702727, 30.966942],
                    [120.70553, 30.966451],
                    [120.707418, 30.967913],
                    [120.708609, 30.97129],
                    [120.710076, 30.971898],
                    [120.714243, 30.970307],
                    [120.7256, 30.971536],
                    [120.727589, 30.971173],
                    [120.731946, 30.968702],
                    [120.736114, 30.96372],
                    [120.740282, 30.962297],
                    [120.745945, 30.962504],
                    [120.748022, 30.963668],
                    [120.753715, 30.96909],
                    [120.755559, 30.972053],
                    [120.758463, 30.974538],
                    [120.763285, 30.975961],
                    [120.766625, 30.976142],
                    [120.769703, 30.977294],
                    [120.770197, 30.979234],
                    [120.768861, 30.982132],
                    [120.76783, 30.98754],
                    [120.76966, 30.99353],
                    [120.769921, 30.996622],
                    [120.775077, 30.995056],
                    [120.780987, 31.000942],
                    [120.802916, 31.005404],
                    [120.81433, 31.005754],
                    [120.820894, 31.006362],
                    [120.830842, 31.002197],
                    [120.840063, 30.997825],
                    [120.842547, 30.993064],
                    [120.845829, 30.992482],
                    [120.847397, 30.989597],
                    [120.849982, 30.990309],
                    [120.854368, 30.993219],
                    [120.858652, 30.98983],
                    [120.861251, 30.990774],
                    [120.865666, 30.989882],
                    [120.867336, 30.990981],
                    [120.868033, 30.995367],
                    [120.873072, 30.99525],
                    [120.875584, 30.996958],
                    [120.879941, 30.997527],
                    [120.880173, 30.998898],
                    [120.889438, 31.002442],
                    [120.891355, 31.003736],
                    [120.891617, 31.010087],
                    [120.894637, 31.011716],
                    [120.895146, 31.017355],
                    [120.900272, 31.016928],
                    [120.901361, 31.017498],
                    [120.900562, 31.020433],
                    [120.901347, 31.025503],
                    [120.901971, 31.037645],
                    [120.899735, 31.039597],
                    [120.897019, 31.045584],
                    [120.897208, 31.048221],
                    [120.895436, 31.050329],
                    [120.894565, 31.053897],
                    [120.894623, 31.058654],
                    [120.895915, 31.063075],
                    [120.898863, 31.070508],
                    [120.899618, 31.078366],
                    [120.904614, 31.078521],
                    [120.90473, 31.080499],
                    [120.901681, 31.084092],
                    [120.902116, 31.085656],
                    [120.899299, 31.086935],
                    [120.8967, 31.086651],
                    [120.895422, 31.090709],
                    [120.892169, 31.094185],
                    [120.892837, 31.096537],
                    [120.891225, 31.09717],
                    [120.891021, 31.094301],
                    [120.887478, 31.094068],
                    [120.878082, 31.095761],
                    [120.878968, 31.098385],
                    [120.876006, 31.097868],
                    [120.87663, 31.099948],
                    [120.873174, 31.100323],
                    [120.872549, 31.098888],
                    [120.869805, 31.09894],
                    [120.869572, 31.097222],
                    [120.865753, 31.097622],
                    [120.863996, 31.100297],
                    [120.85977, 31.100284],
                    [120.856807, 31.10283],
                    [120.856851, 31.103889],
                    [120.857911, 31.108528],
                    [120.86022, 31.109329],
                    [120.862253, 31.112507],
                    [120.865971, 31.114742],
                    [120.870589, 31.119716],
                    [120.871024, 31.123799],
                    [120.872346, 31.127157],
                    [120.876427, 31.131485],
                    [120.881292, 31.134727],
                    [120.899212, 31.136057],
                    [120.905398, 31.13421],
                    [120.916914, 31.136187],
                    [120.930333, 31.141405],
                    [120.952639, 31.138253],
                    [120.983905, 31.131704],
                    [120.991253, 31.133177],
                    [121.007271, 31.133422],
                    [121.018482, 31.134094],
                    [121.02281, 31.138318],
                    [121.022272, 31.140462],
                    [121.025671, 31.140772],
                    [121.026716, 31.143768],
                    [121.028372, 31.143872],
                    [121.028778, 31.14125],
                    [121.033091, 31.142206],
                    [121.036127, 31.140333],
                    [121.036257, 31.137375],
                    [121.038639, 31.13691],
                    [121.041819, 31.138899],
                    [121.044782, 31.145525],
                    [121.041543, 31.146933],
                    [121.041471, 31.149826],
                    [121.045246, 31.151582],
                    [121.045421, 31.154036],
                    [121.049124, 31.154604],
                    [121.050271, 31.150717],
                    [121.055833, 31.150665],
                    [121.057372, 31.152783],
                    [121.062557, 31.153132],
                    [121.06414, 31.150846],
                    [121.066057, 31.150949],
                    [121.065723, 31.148599],
                    [121.069121, 31.148702],
                    [121.06777, 31.152292],
                    [121.07204, 31.153506],
                    [121.073841, 31.157071],
                    [121.077035, 31.158452],
                    [121.076048, 31.160544],
                    [121.076789, 31.162624],
                    [121.073695, 31.161707],
                    [121.073129, 31.163256],
                    [121.077369, 31.164535],
                    [121.075467, 31.170319],
                    [121.072388, 31.169609],
                    [121.072534, 31.172695],
                    [121.075423, 31.173444],
                    [121.074233, 31.17622],
                    [121.071401, 31.179474],
                    [121.071227, 31.181462],
                    [121.075583, 31.182856],
                    [121.074988, 31.18438],
                    [121.069469, 31.182895],
                    [121.068758, 31.184896],
                    [121.071677, 31.185955],
                    [121.070341, 31.188743],
                    [121.070617, 31.191299],
                    [121.072563, 31.191532],
                    [121.072185, 31.193171],
                    [121.070108, 31.19361],
                    [121.0696, 31.195314],
                    [121.066797, 31.194966],
                    [121.066609, 31.197186],
                    [121.069208, 31.196515],
                    [121.067814, 31.200994],
                    [121.065621, 31.211875],
                    [121.062629, 31.224664],
                    [121.062804, 31.226961],
                    [121.064721, 31.227271],
                    [121.064648, 31.230781],
                    [121.067175, 31.230923],
                    [121.067378, 31.232936],
                    [121.064575, 31.232961],
                    [121.0626, 31.23469],
                    [121.061235, 31.237826],
                    [121.063907, 31.238445],
                    [121.063559, 31.242213],
                    [121.064343, 31.246135],
                    [121.061656, 31.245245],
                    [121.057677, 31.246754],
                    [121.060974, 31.246483],
                    [121.061947, 31.257939],
                    [121.063239, 31.267911],
                    [121.0687, 31.268091],
                    [121.072737, 31.269149],
                    [121.080419, 31.270155],
                    [121.082147, 31.271535],
                    [121.084543, 31.275714],
                    [121.081363, 31.277262],
                    [121.084703, 31.287605],
                    [121.087332, 31.290662],
                    [121.08691, 31.291719],
                    [121.090134, 31.291899],
                    [121.093082, 31.288211],
                    [121.095406, 31.286999],
                    [121.098804, 31.276256],
                    [121.105441, 31.273651],
                    [121.103829, 31.275327],
                    [121.106675, 31.276707],
                    [121.111119, 31.281737],
                    [121.114996, 31.285271],
                    [121.119295, 31.285116],
                    [121.120369, 31.286148],
                    [121.125017, 31.284407],
                    [121.124319, 31.283104],
                    [121.127209, 31.281208],
                    [121.131058, 31.280112],
                    [121.131682, 31.281363],
                    [121.138028, 31.278745],
                    [121.137607, 31.277597],
                    [121.141151, 31.276733],
                    [121.142879, 31.277662],
                    [121.142995, 31.275469],
                    [121.150387, 31.275443],
                    [121.154221, 31.276733],
                    [121.155542, 31.280757],
                    [121.159405, 31.28157],
                    [121.161293, 31.283981],
                    [121.159303, 31.287657],
                    [121.156399, 31.287412],
                    [121.151287, 31.291938],
                    [121.152725, 31.294079],
                    [121.148935, 31.298876],
                    [121.150793, 31.299018],
                    [121.146901, 31.305929],
                    [121.143779, 31.309694],
                    [121.138958, 31.305632],
                    [121.139655, 31.302989],
                    [121.133773, 31.302074],
                    [121.129954, 31.302589],
                    [121.129141, 31.307528],
                    [121.12978, 31.308314],
                    [121.127965, 31.311885],
                    [121.128633, 31.314258],
                    [121.127079, 31.316939],
                    [121.127253, 31.319311],
                    [121.131639, 31.323243],
                    [121.131537, 31.325435],
                    [121.133309, 31.325577],
                    [121.132583, 31.33197],
                    [121.131145, 31.332112],
                    [121.130114, 31.334703],
                    [121.130811, 31.341508],
                    [121.130433, 31.344202],
                    [121.123942, 31.342759],
                    [121.117973, 31.343455],
                    [121.11732, 31.347128],
                    [121.120195, 31.347566],
                    [121.117247, 31.35169],
                    [121.111845, 31.350517],
                    [121.111162, 31.351535],
                    [121.108331, 31.350646],
                    [121.108418, 31.354035],
                    [121.107358, 31.354757],
                    [121.108243, 31.360453],
                    [121.106762, 31.364538],
                    [121.106951, 31.366599],
                    [121.108897, 31.366509],
                    [121.109275, 31.364705],
                    [121.112847, 31.365131],
                    [121.113166, 31.36687],
                    [121.12021, 31.368674],
                    [121.119077, 31.370555],
                    [121.115229, 31.371135],
                    [121.113747, 31.374446],
                    [121.118206, 31.375838],
                    [121.123288, 31.378479],
                    [121.124276, 31.376727],
                    [121.131247, 31.379664],
                    [121.131769, 31.378814],
                    [121.138406, 31.381146],
                    [121.13752, 31.382795],
                    [121.141049, 31.384534],
                    [121.141427, 31.383542],
                    [121.148441, 31.38541],
                    [121.148978, 31.386905],
                    [121.14709, 31.389906],
                    [121.143823, 31.392328],
                    [121.149472, 31.394492],
                    [121.147657, 31.397326],
                    [121.152739, 31.398163],
                    [121.149588, 31.399387],
                    [121.150488, 31.402208],
                    [121.153901, 31.403689],
                    [121.153102, 31.40584],
                    [121.157895, 31.407888],
                    [121.158868, 31.410116],
                    [121.154511, 31.411571],
                    [121.155513, 31.413825],
                    [121.153494, 31.413671],
                    [121.148905, 31.41586],
                    [121.149269, 31.419131],
                    [121.146204, 31.419698],
                    [121.146248, 31.421076],
                    [121.151156, 31.421797],
                    [121.155281, 31.42575],
                    [121.161365, 31.425776],
                    [121.162004, 31.427952],
                    [121.164299, 31.427218],
                    [121.162527, 31.429575],
                    [121.162716, 31.432214],
                    [121.154976, 31.432755],
                    [121.14982, 31.43488],
                    [121.146872, 31.437262],
                    [121.14786, 31.439451],
                    [121.146887, 31.441266],
                    [121.147337, 31.443931],
                    [121.160915, 31.449686],
                    [121.16305, 31.448875],
                    [121.166056, 31.450175],
                    [121.167726, 31.448321],
                    [121.169832, 31.450021],
                    [121.174973, 31.449287],
                    [121.180825, 31.451462],
                    [121.186053, 31.454359],
                    [121.185458, 31.457474],
                    [121.186068, 31.460821],
                    [121.195042, 31.467823],
                    [121.202899, 31.469355],
                    [121.203422, 31.472341],
                    [121.20637, 31.474993],
                    [121.214371, 31.479124],
                    [121.215025, 31.477528],
                    [121.213645, 31.475932],
                    [121.219062, 31.475224],
                    [121.220732, 31.476074],
                    [121.22535, 31.476022],
                    [121.226207, 31.477682],
                    [121.23036, 31.477425],
                    [121.230839, 31.481106],
                    [121.228676, 31.482135],
                    [121.233003, 31.487901],
                    [121.235414, 31.488107],
                    [121.234746, 31.492688],
                    [121.238071, 31.491903],
                    [121.240889, 31.493691],
                    [121.24115, 31.490912],
                    [121.243793, 31.487322],
                    [121.244403, 31.481183],
                    [121.248179, 31.481878],
                    [121.245812, 31.479883],
                    [121.247075, 31.477065],
                    [121.249689, 31.477618],
                    [121.251228, 31.4796],
                    [121.253363, 31.479806],
                    [121.253625, 31.483088],
                    [121.255643, 31.483628],
                    [121.254801, 31.477644],
                    [121.261467, 31.478854],
                    [121.261728, 31.480784],
                    [121.265155, 31.483126],
                    [121.267435, 31.483358],
                    [121.267319, 31.486228],
                    [121.268873, 31.487463],
                    [121.272039, 31.484336],
                    [121.276221, 31.485378],
                    [121.276453, 31.486652],
                    [121.280331, 31.488673],
                    [121.279692, 31.49041],
                    [121.283685, 31.489792],
                    [121.285355, 31.49068],
                    [121.289378, 31.48902],
                    [121.290612, 31.491697],
                    [121.293488, 31.489805],
                    [121.2986, 31.491517],
                    [121.298556, 31.493717],
                    [121.300502, 31.494528],
                    [121.299936, 31.499752],
                    [121.302593, 31.502595],
                    [121.305875, 31.503445],
                    [121.305527, 31.505336],
                    [121.310348, 31.505915],
                    [121.311931, 31.502904],
                    [121.315344, 31.50127],
                    [121.316651, 31.505774],
                    [121.320165, 31.505876],
                    [121.321893, 31.503406],
                    [121.320034, 31.502994],
                    [121.319904, 31.499726],
                    [121.323708, 31.499649],
                    [121.323128, 31.502287],
                    [121.327208, 31.504242],
                    [121.329517, 31.504255],
                    [121.335834, 31.508295],
                    [121.343502, 31.512052],
                    [121.372212, 31.553212],
                    [121.345593, 31.571689],
                    [121.289102, 31.61628],
                    [121.179867, 31.720777],
                    [121.145333, 31.753927],
                    [121.142066, 31.755313],
                    [121.118496, 31.759073],
                    [121.101215, 31.762524],
                    [121.076861, 31.776996],
                    [121.06064, 31.783064],
                    [121.018715, 31.783513],
                    [120.959508, 31.783038],
                    [120.932903, 31.786707],
                    [120.916638, 31.793659],
                    [120.89532, 31.81977],
                    [120.889816, 31.826964],
                    [120.883862, 31.83472],
                    [120.860336, 31.873059],
                    [120.853467, 31.888654],
                    [120.803133, 31.98844],
                    [120.790078, 31.998091],
                    [120.782047, 32.015993],
                    [120.770764, 32.020612],
                    [120.761586, 32.020446],
                    [120.741008, 32.017861],
                    [120.702495, 32.013357],
                    [120.674235, 32.007548],
                    [120.652655, 32.002391],
                    [120.641749, 32.000983],
                    [120.628389, 32.001162],
                    [120.608493, 32.006243],
                    [120.588308, 32.009698],
                    [120.524642, 32.030438],
                    [120.503803, 32.041018],
                    [120.465668, 32.045827],
                    [120.40376, 32.016224],
                    [120.387858, 32.006652],
                    [120.380525, 31.998283],
                    [120.370708, 31.990821],
                    [120.368878, 31.961084],
                    [120.371594, 31.954951],
                    [120.373525, 31.946436],
                    [120.37534, 31.941724],
                    [120.386, 31.935615],
                    [120.390313, 31.932196],
                    [120.391257, 31.92861],
                    [120.390487, 31.925856],
                    [120.381062, 31.918888],
                    [120.379349, 31.914149],
                    [120.379755, 31.912189],
                    [120.382645, 31.910946],
                    [120.385215, 31.911715],
                    [120.385143, 31.909524],
                    [120.38857, 31.909217],
                    [120.390908, 31.907923],
                    [120.39207, 31.90531],
                    [120.396412, 31.908179],
                    [120.397908, 31.906155],
                    [120.401306, 31.905361],
                    [120.402381, 31.907385],
                    [120.407739, 31.905515],
                    [120.426894, 31.897866],
                    [120.436856, 31.895611],
                    [120.449549, 31.891947],
                    [120.466496, 31.889974],
                    [120.466583, 31.887783],
                    [120.468819, 31.87962],
                    [120.471303, 31.879197],
                    [120.48459, 31.874418],
                    [120.490879, 31.871329],
                    [120.492258, 31.865472],
                    [120.496077, 31.860884],
                    [120.502061, 31.852142],
                    [120.50328, 31.841707],
                    [120.508291, 31.843694],
                    [120.514419, 31.841528],
                    [120.517396, 31.837951],
                    [120.521985, 31.834182],
                    [120.52881, 31.831348],
                    [120.531308, 31.827848],
                    [120.529319, 31.821322],
                    [120.530829, 31.817039],
                    [120.529958, 31.814679],
                    [120.523699, 31.810537],
                    [120.522537, 31.806293],
                    [120.523945, 31.801291],
                    [120.526516, 31.795545],
                    [120.531148, 31.79321],
                    [120.531555, 31.787798],
                    [120.544393, 31.787143],
                    [120.544494, 31.789465],
                    [120.546237, 31.791928],
                    [120.548923, 31.792056],
                    [120.555487, 31.79407],
                    [120.555851, 31.786874],
                    [120.558377, 31.785707],
                    [120.570707, 31.793775],
                    [120.580741, 31.784796],
                    [120.584241, 31.782141],
                    [120.588743, 31.771608],
                    [120.589411, 31.766181],
                    [120.588525, 31.762563],
                    [120.594842, 31.760433],
                    [120.59766, 31.755031],
                    [120.600027, 31.744624],
                    [120.598749, 31.742802],
                    [120.594828, 31.741146],
                    [120.593332, 31.738169],
                    [120.58944, 31.734934],
                    [120.585606, 31.735409],
                    [120.584357, 31.734472],
                    [120.581714, 31.727631],
                    [120.582455, 31.721175],
                    [120.584575, 31.717927],
                    [120.585098, 31.714435],
                    [120.589847, 31.714114],
                    [120.590834, 31.712997],
                    [120.596788, 31.710828],
                    [120.599083, 31.710712],
                    [120.600811, 31.708851],
                    [120.60023, 31.706874],
                    [120.595728, 31.705603],
                    [120.592809, 31.700814],
                    [120.587204, 31.69623],
                    [120.584924, 31.692815],
                    [120.578113, 31.693701],
                    [120.578374, 31.689951],
                    [120.575586, 31.691826],
                    [120.576835, 31.689463],
                    [120.572406, 31.689694],
                    [120.570053, 31.688911],
                    [120.568049, 31.6852],
                    [120.566234, 31.685393],
                    [120.566089, 31.68312],
                    [120.562865, 31.680513],
                    [120.564172, 31.678907],
                    [120.566626, 31.678676],
                    [120.566379, 31.676146],
                    [120.568761, 31.668594],
                    [120.568615, 31.665178],
                    [120.5668, 31.659925],
                    [120.558581, 31.658512],
                    [120.561064, 31.655686],
                    [120.571738, 31.655776],
                    [120.583428, 31.65196],
                    [120.586637, 31.651819],
                    [120.592127, 31.650278],
                    [120.594421, 31.645409],
                    [120.595859, 31.643764],
                    [120.589585, 31.636531],
                    [120.595569, 31.631392],
                    [120.592098, 31.625044],
                    [120.600608, 31.617115],
                    [120.596266, 31.613299],
                    [120.591488, 31.611499],
                    [120.584474, 31.61344],
                    [120.577082, 31.61416],
                    [120.570024, 31.609443],
                    [120.567134, 31.609173],
                    [120.56834, 31.606179],
                    [120.566466, 31.601924],
                    [120.557056, 31.600305],
                    [120.553106, 31.605613],
                    [120.546251, 31.604688],
                    [120.543086, 31.601745],
                    [120.54509, 31.585716],
                    [120.547776, 31.583286],
                    [120.546847, 31.579686],
                    [120.547994, 31.576601],
                    [120.550216, 31.575019],
                    [120.553062, 31.575084],
                    [120.56362, 31.579596],
                    [120.568252, 31.576292],
                    [120.57303, 31.577475],
                    [120.56741, 31.583993],
                    [120.570431, 31.585664],
                    [120.573829, 31.585947],
                    [120.584256, 31.585137],
                    [120.587044, 31.583389],
                    [120.594567, 31.576009],
                    [120.595961, 31.571497],
                    [120.597544, 31.563859],
                    [120.599272, 31.548467],
                    [120.605022, 31.546075],
                    [120.602815, 31.541175],
                    [120.602917, 31.538268],
                    [120.605124, 31.535683],
                    [120.604195, 31.532094],
                    [120.605763, 31.525238],
                    [120.60235, 31.518986],
                    [120.600027, 31.518613],
                    [120.598575, 31.516169],
                    [120.595641, 31.517147],
                    [120.593986, 31.525495],
                    [120.592766, 31.527553],
                    [120.589832, 31.526962],
                    [120.585781, 31.524531],
                    [120.576922, 31.517507],
                    [120.568543, 31.512374],
                    [120.559859, 31.508964],
                    [120.555197, 31.507575],
                    [120.551625, 31.50064],
                    [120.548502, 31.497397],
                    [120.548038, 31.495081],
                    [120.549083, 31.489175],
                    [120.553004, 31.48673],
                    [120.555241, 31.480295],
                    [120.554108, 31.476241],
                    [120.550724, 31.475906],
                    [120.546368, 31.473126],
                    [120.543565, 31.470269],
                    [120.537306, 31.468364],
                    [120.536159, 31.467103],
                    [120.531105, 31.466613],
                    [120.526022, 31.468338],
                    [120.523844, 31.468364],
                    [120.516002, 31.464425],
                    [120.515973, 31.460229],
                    [120.517367, 31.457822],
                    [120.513853, 31.456187],
                    [120.512357, 31.457088],
                    [120.508537, 31.455646],
                    [120.505038, 31.457963],
                    [120.501407, 31.457551],
                    [120.495424, 31.451089],
                    [120.495758, 31.447935],
                    [120.48703, 31.448617],
                    [120.484794, 31.447484],
                    [120.485418, 31.449905],
                    [120.480553, 31.449132],
                    [120.474439, 31.44657],
                    [120.460179, 31.445489],
                    [120.438178, 31.448772],
                    [120.43173, 31.448643],
                    [120.437481, 31.443043],
                    [120.434997, 31.442605],
                    [120.430539, 31.44639],
                    [120.426589, 31.445437],
                    [120.422639, 31.448991],
                    [120.41882, 31.448386],
                    [120.355823, 31.416452],
                    [120.33555, 31.40736],
                    [120.317586, 31.398125],
                    [120.308146, 31.393268],
                    [120.253122, 31.366097],
                    [120.209614, 31.345659],
                    [120.206593, 31.342565]
                  ]
                ]
              ]
            }
          }
        ]
      }

      let countryLayer = L.geoJson(geojson, {
        style: {
          weight: 5,
          opacity: 1,
          // color: '#cc91f6',
          fillOpacity: 0,
          fillColor: '#6ba7de'
        }
      }).addTo(map)

      map.fitBounds(countryLayer.getBounds())

      //遮罩层遮蔽层,geojson分两种情况
      let latlngs
      let feature = geojson['features'][0].geometry.coordinates
      console.log(feature[0],'dd');
      console.log(feature[0][0][0],'dd');

      if (feature[0][0][0] instanceof Array) {
        latlngs = feature[0]
      } else {
        latlngs = feature
      }

      // 中国方位角
      var pNW = { lat: 59.0, lng: 73.0 }
      var pNE = { lat: 59.0, lng: 136.0 }
      var pSE = { lat: 3.0, lng: 136.0 }
      var pSW = { lat: 3.0, lng: 73.0 }
      //向数组中添加一次闭合多边形，并将西北角再加一次作为之后画闭合区域的起点
      var pArray = []
      pArray.push(pNW)
      pArray.push(pSW)
      pArray.push(pSE)
      pArray.push(pNE)
      pArray.push(pNW)
      //循环添加各闭合区域
      for (var i = 0; i < latlngs.length; i++) {
        var points = []
        latlngs[i].forEach((k, v) => {
          // console.log(k,v);
          points.push({ lat: Number(k[1]), lng: Number(k[0]) })
        })
        //将闭合区域加到遮蔽层上，每次添加完后要再加一次西北角作为下次添加的起点和最后一次的终点
        pArray = pArray.concat(points)
        pArray.push(pArray[0])
      }
      //反向遮蔽层
      ahLayer = L.polygon(pArray, {
        color: 'transparent',
        fillColor: '#00a2ff',
        fillOpacity: 0.6
      }) //建立多边形覆盖物
      ahLayer.addTo(map)
    </script>
  </body>
</html>
